using System;

namespace MiniFlower
{
    public abstract class CharacterBase: Actor
    {
        protected ControllerBase m_Controller;

        protected CharacterBase(ActorParameters actorParameters) : base(actorParameters)
        {
        }

        public ControllerBase Controller => m_Controller;

        public virtual void PossessedBy(ControllerBase controller)
        {
            if(controller == null)
            {
                throw new ArgumentNullException(nameof(controller));
            }
            m_Controller = controller;
        }

        public virtual void UnPossessed()
        {
            m_Controller = null;
        }
    }

}
